package com.aolong.archives.core.sysmanage.dao.impl;

import java.util.HashMap;
import java.util.Map;

import com.aolong.archives.core.sysmanage.dao.II18nResourceDao;
import com.rock.platform.dao.BaseDao;
import com.rock.platform.util.GUID;

public class I18nResourceDao extends BaseDao implements II18nResourceDao {

	public void add(String key, String text, String language) {

		String strSql = "insert into TSM_I18nResource(Id,ResourceKey,Text,Language)"
					+ " select :id,:key,:text,:language " 
					+ " where not exists(select 0 from TSM_I18nResource where ResourceKey = :key and Language = :language)";
		Map<String,Object> params = new HashMap<String,Object>();
		params.put("id", GUID.NEWID());
		params.put("key", key);
		params.put("text", text);
		params.put("language", language);
		super.execute(strSql, params);
	}

}
